package com.example.hotbar;

import android.inputmethodservice.Keyboard.Key;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.EditText;
import android.widget.TextView;

public class SearchByCityView extends Activity {
    TextView name,location;
    String gotData;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_search_by_city_view);
		TextView tv = (TextView) findViewById(R.id.tvSQLCitySearch);
		//name = (EditText) findViewById(R.id.addBarsNameEditText);
		
		//location = (EditText) findViewById(R.id.addBarsCityEditText);
		Bundle gotDataStream = getIntent().getExtras();
		gotData = gotDataStream.getString("key");
		HotBarDB data = new HotBarDB(SearchByCityView.this);
		data.open();
		
		String newData = data.getAllBarsInCity(gotData);
		tv.setText(newData);
		data.close();
		
		/*HotBarDB info = new HotBarDB(this);
		
		String data = info.getData();
		info.close();
		tv.setText(data);
		
		
		
		TextView tv = (TextView) findViewById(R.id.tvSQLCitySearch);
		Intent intent = getIntent();
		//String search = intent.getStringExtra(search);
		HotBarDB info = new HotBarDB(this);
		info.open();
		
		
		info.close();*/
		//tv.setText();
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.search_by_city_view, menu);
		return true;
	}

}
